locale country code fix

jamesperet 10 年之前
父節點
當前提交
93e948e770
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/controllers/application_controller.rb

+ 2 - 2
app/controllers/application_controller.rb

@@ -27,10 +27,10 @@ class ApplicationController < ActionController::Base
27 27
           country_code = request.location.country_code
28 28
           http_accept_language = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first
29 29
           if http_accept_language != ''
30
-            [:"pt-BR", :pt, :br].include?(http_accept_language) ? l = :"pt-BR" : l = @config.default_language
30
+            [:"pt-BR", :"pt-br", :pt, :br].include?(http_accept_language) ? l = :"pt-BR" : l = @config.default_language
31 31
           elsif country_code != ''
32 32
             country_code = country_code.downcase.to_sym
33
-            [:"pt-BR", :pt, :br].include?(country_code) ? l = :"pt-BR" : l = @config.default_language
33
+            [:"pt-BR", :"pt-br", :pt, :br].include?(country_code) ? l = :"pt-BR" : l = @config.default_language
34 34
           else
35 35
             l = @config.default_language # use default locale if cannot retrieve this info
36 36
           end